<?php
/**
 * @ClassName: AgentAward
 * @Description: 代理奖励
 * @author: gydtrade
 * @Date: 2025-05-28 13:36
 * @Version: V1.0.0
 */

namespace app\common\model;

use think\Model;

class AgentAward extends Model
{
    protected $name = 'agent_award';

    protected $autoWriteTimestamp = 'dateTime';

    protected $append = ['type_name'];

    const type_1 = 1;
    const type_2 = 2;
    const type_3 = 3;
    const type_4 = 4;

    public static $types = [
        self::type_1 => '招商奖',
        self::type_2 => '培养奖',
        self::type_3 => '运营奖',
        self::type_4 => '直推奖',
    ];

    public function getTypeNameAttr($value, $data)
    {
        return self::$types[$data['type']];
    }

}